package com.spzx.channel.controller;

import com.spzx.channel.service.CategoryService;
import com.spzx.common.core.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Haoran Sun
 * @since 2024/07/24
 */
@Tag(name = "分类管理")
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Resource
    private CategoryService categoryService;

    @GetMapping(value = "/tree")
    @Operation(summary = "获取分类列表")
    public AjaxResult tree(){
        return AjaxResult.success(categoryService.tree());
    }
}
